﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Gfw.Web.Models.User
{
    /// <summary>
    /// 用户绑定信息表
    /// </summary>
    public class UserBindingInfoModel
    {
        // BMK Basic Info
        [Key]
        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "用户ID：")]
        public string UserID { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "用户登录名：")]
        public string LoginName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "身份证号：")]
        [RegularExpression(@"\d{17}[\d|X]|\d{15}", ErrorMessage = "身份证号错误")]
        //[RegularExpression(@"/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[A-Z])$/")] // 18 位
        //[RegularExpression(@"/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/")] // 15 位
        public string IDCard { get; set; }


        // BMK Lock
        [DataType(DataType.Text)]
        [Display(Name = "是否锁定账户：")]
        public bool IsLock { get; set; }

        /// <summary>
        /// 用 string 目的，可显示“无”
        /// </summary>
        [DataType(DataType.Text)]
        [Display(Name = "锁定账户日期：")]
        public string LockDate { get; set; }

        [DataType(DataType.MultilineText)]
        [Display(Name = "说明：")]
        public string LockReason { get; set; }


        // BMK Bank
        [DataType(DataType.Text)]
        [Display(Name = "开户银行名称：")]
        public string BankName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "银行卡号：")]
        public string BankCardNo { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "开户名：", Description = "自己的姓名")]
        public string BankUserName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "开户银行地址：")]
        public string BankAddress { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "财付通账号：")]
        public string Tenpay { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "支付宝账号：")]
        public string Alipay { get; set; }



        #region 以下属性只用于显示*时的处理

        [DataType(DataType.Text)]
        [Display(Name = "身份证号：")]
        public string ShowIDCard { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "银行卡号：")]
        public string ShowBankCardNo { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "开户名：", Description = "自己的姓名")]
        public string ShowBankUserName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "开户银行地址：")]
        public string ShowBankAddress { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "财付通账号：")]
        public string ShowTenpay { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "支付宝账号：")]
        public string ShowAlipay { get; set; }

        #endregion
    }
}
